/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.speechacts.coachlanguage;

public class DefineMessage {

	private TypeConstants.DEFINETYPE defineType = TypeConstants.DEFINETYPE.INIT;

	private DefineCondition defineCondition = null;

	private DefineAction defineAction = null;

	private DefineRegion defineRegion = null;

	private DefineDirective defineDirective = null;

	private Definerset definerset = null;

	private DefineRule defineRule = null;

	public DefineDirective getDefineDirective() {
		return defineDirective;
	}

	public void setDefineDirective(DefineDirective defineDirective) {
		this.defineDirective = defineDirective;
		this.defineType = TypeConstants.DEFINETYPE.DEFINED;
	}

	public DefineRegion getDefineRegion() {
		return defineRegion;
	}

	public void setDefineRegion(DefineRegion defineRegion) {
		this.defineRegion = defineRegion;
		this.defineType = TypeConstants.DEFINETYPE.DEFINER;
	}

	public DefineRule getDefineRule() {
		return defineRule;
	}

	public void setDefineRule(DefineRule defineRule) {
		this.defineRule = defineRule;
		this.defineType = TypeConstants.DEFINETYPE.DEFINERULE;
	}

	public DefineCondition getDefineCondition() {
		return defineCondition;
	}

	public void setDefineCondition(DefineCondition defineCondition) {
		this.defineCondition = defineCondition;
		this.defineType = TypeConstants.DEFINETYPE.DEFINEC;
	}

	public DefineAction getDefineAction() {
		return defineAction;
	}

	public void setDefineAction(DefineAction defineAction) {
		this.defineAction = defineAction;
		this.defineType = TypeConstants.DEFINETYPE.DEFINEA;
	}

	public TypeConstants.DEFINETYPE getDefineType() {
		return defineType;
	}

	public void setDefineType(TypeConstants.DEFINETYPE defineType) {
		this.defineType = defineType;
	}

	public Definerset getDefinerset() {
		return definerset;
	}

	public void setDefinerset(Definerset definerset) {
		this.definerset = definerset;
		this.defineType = TypeConstants.DEFINETYPE.DEFINERSET;
	}

	public String toString() {
		StringBuffer buf = new StringBuffer();

		switch (this.defineType) {

		case INIT:
			buf.append("empty");
			break;

		case DEFINEC:
			buf.append(defineCondition.toString());
			break;

		case DEFINEA:
			buf.append(defineAction.toString());
			break;

		case DEFINER:
			buf.append(defineRegion.toString());
			break;

		case DEFINED:
			buf.append(defineDirective.toString());
			break;

		case DEFINERULE:
			buf.append(defineRule.toString());
			break;
		}

		return buf.toString();
	}

}
